package com.zsh.weather.ln.base


abstract class BaseMVPFragment<in V : IView, P : IPresenter<in V>> : BaseFragment(), IView {
    protected lateinit var presenter: P
    override fun initData() {
        presenter = createPresenter()
        presenter.attachView(this as V)
    }

    override fun onDestroy() {
        super.onDestroy()
        if (presenter != null) presenter.detachView()
    }

    /*
    * presenter
    * */
    abstract fun createPresenter(): P
}